package cn.jbit.controller;

import cn.jbit.service.OrderService;
import cn.jbit.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张在成
 */
@RestController
@Slf4j
public class OrderController {

    @Autowired
    private OrderService  orderService;

    @RequestMapping("/order/{orderId}")
    public Result getOrderDetailByOrderId(@PathVariable("orderId") Integer orderId){
        Result result=null;
        try {
            result=orderService.selectOrderByOrderId(orderId);
        }catch (Exception e){
            e.printStackTrace();
            log.info("系统出现故障："+e.getMessage());
        }
        return result;
    }




}
